package com.sjtu.dao.model;

import com.sjtu.constants.TaskConstants;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.SQLDelete;

import javax.persistence.*;
import java.util.Date;

/**
 * nerine
 * 1/28/2020
 */
@SQLDelete(sql="UPDATE job_run_history SET is_deleted = 1 WHERE id_Job_Run_History = ?")
@Getter
@Setter
@ToString
@Entity(name = "job_run_history")
public class JobRunHistory extends BaseModel {
    @Id
    private String idJobRunHistory;
    /** 分实例的任务共享的父流水号 */
    private String commonRunId;
    /** 任务 */
    @OneToOne
    @JoinColumn(name = "id_task_info")
    private TaskInfo taskInfo;
    /** 对应的子系统 */
    @OneToOne
    @JoinColumn(name = "id_client_info")
    private ClientInfo clientInfo;
    /** 运行状态 */
    @Enumerated(EnumType.STRING)
    private TaskConstants.TaskRunStatus status;
    /** 其余信息 */
    private String remark;
    /** 定时任务开始时间 */
    private Date runBeginTime;
    /** 定时任务结束时间 */
    private Date runEndTime;
    /** 运行任务的实例 */
    private String instance;
}